<%@ page pageEncoding="utf-8"%>
<%-- 引入JSTL标签库 --%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html>
<head>
	<title>用户管理</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<script type="text/javascript" src="/resources/js/jquery-1.11.3.min.js"></script>
	<script type="text/javascript" src="/resources/js/commons.js"></script>
	<link rel="stylesheet" type="text/css" href="/resources/css/commons.css" />
	<script type="text/javascript">

		$(function () {
			var loginUserRoleId = '<%= session.getAttribute("loginUserRoleId") %>';
			if(loginUserRoleId == '1'){
				$(".deleteInfo").show();
			}else if(loginUserRoleId == '2'){
				$(".deleteInfo").hide();
			}
		});

	</script>
</head>
<body>
	<h2>用户管理</h2>
	<div id="add-sysUser">
		<a href="sys/user/add" target="rightFrame">新增</a>
	</div>
	<hr/>
	<table border="1">
		<tr>
			<th class="width-40">序号</th>
			<th>账号</th>
			<th>密码</th>
			<th>名称</th>
			<th>邮箱</th>
			<th>生日</th>
			<th>手机号码</th>
			<th>QQ号码</th>
			<th>状态</th>
			<th>创建时间</th>
			<th>注册时间</th>
			<th>允许登录次数</th>
			<th>登录时间</th>
			<th>修改时间</th>
			<th>登录总次数</th>
			<th class="width-80">操 作</th>
		</tr>

		<!-- 模版数据 -->
	<c:forEach items="${ list }" var="user" varStatus="varStatus">
		<tr>
			<td>${ varStatus.count }</td>
			<td>${ user.account }</td>
			<td>${ user.password }</td>
			<td>${ user.name }</td>
			<td>${ user.email }</td>
			<td>${ user.birthday }</td>
			<td>${ user.mobile }</td>
			<td>${ user.qqnumber }</td>
			<td>
				<c:if test="${user.state eq 1}">
					<p>在线<p>
				</c:if>
				<c:if test="${user.state eq 0}">
					<p>下线<p>
				</c:if>
				<c:if test="${user.state eq -1}">
					<p>禁用<p>
				</c:if>
			</td>
			<td>${ user.createTime }</td>
			<td>${ user.logonTime }</td>
			<td>${ user.restLoginChances }</td>
			<td>${ user.lastTimeLogin }</td>
			<td>${ user.lastTimeModify }</td>
			<td>${ user.loginNum }</td>
			<td>
				<a class="deleteInfo" href="/sysUserDelete?id=${ user.id }" style="color: red;">删除</a>
				<br/>
				<a class="updateInfo" href="/sysUserInfo?id=${ user.id }">修改</a>
			</td>
		</tr>
	</c:forEach>	
	</table>
</body>
</html>



